<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page contentType="text/html;charset=UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<link href="themes/css/ui.common.css" rel="stylesheet" type="text/css" />
		<link href="themes/css/ui.child.css" rel="stylesheet" type="text/css" />
		<link href="themes/css/ui.tips.css" rel="stylesheet" type="text/css" />
		<link href="style/jquery_ui/jquery-ui-1.8.custom.css" rel="stylesheet"
			type="text/css" />
		<link id="skin_css" rel="stylesheet" type="text/css"
			href="themes/css/ui.c.blue.css"></link>
		<link rel="stylesheet" href="themes/default/pagination.css"
			type="text/css"></link>
		<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
		<script src="Scripts/jquery-ui-1.8.custom.min.js"
			type="text/javascript"></script>
		<script src="Scripts/ui.tips.js" type="text/javascript"></script>
		<script src="Scripts/ui.default.js " type="text/javascript"
			charset="UTF-8"></script>
		<script src="Scripts/ui.admincp.js" type="text/javascript"
			charset="UTF-8"></script>
		<script type="text/javascript" src="Scripts/jquery.json-2.2.min.js"></script>
		<STYLE type="text/css">
		.editorArea {
			display: none;
		}
		</STYLE>
		<script type="text/javascript" src="Scripts/ui.dialogFormHelper.js"></script>
		<SCRIPT type="text/javascript">
			$(function(){
	            registeRowFuncButton();
			});
			function toDeleteHandler(e)
			{
			   	var id = e.entityId;
			     location="fileSubmit!delete.action?ids="+id+"&currpage="+$("#currentPage").val();
			}
				
			function checkAll(str)
			{
　 				var items = document.getElementsByName(str);　 //获取所有复选框
　				var totalNum = items.length;　 //获取复选框的个数
　 				for (var i=0; i<totalNum; i++)
　 					items[i].checked = window.event.srcElement.checked;//通过单击的按钮判断是选中还是未选
			}
				
			function deleteAll(str)
			{	
				var isTo = checkDeleteAll("文件归档信息记录");

				if(isTo==false)
  				return ;
　 				var items = document.getElementsByName(str);　 //获取所有复选框
　				var totalNum = items.length;　 //获取复选框的个数
				var delStr = "";
　 				for (var i=0; i<totalNum; i++){
　 					if(items[i].checked == true){
						delStr += items[i].value + ","; 
					}
				}
				delStr = delStr.substring(0, delStr.length -1);
				location.href="fileSubmit!delete.action?ids="+delStr+"&currpage="+$("#currentPage").val();
			}
		</script>
		<SCRIPT type="text/javascript">
			var searching = false;
				$(function(){
					$("#link_page_prev,#link_page_next").click(function(){
			    		var currentPage = $(this).attr("currentPage");
			    	 
			    		goToPage(currentPage);
			    	}); 
			    	
			    	$("#searchButton").click(function(){
						searching=true;
			    		goToPage(1);
			    	});
			    	
			    	initSearch();
			    	 
				});
				
				function initSearch()
				{
				    $("#search_drl_fileInfo").val();
				    $("#search_drl_sectionInfo").val();
				    $("#search_txt_createTime").val();
				}
			 
				function goToPage(currentPage)
				{
				    var fileId =$("#search_drl_fileInfo").val();
				    var sectionId = $("#search_drl_sectionInfo").val();
				    var searchTime = $("#search_txt_submitTime").val();
				     
					location.href = "fileSubmit!queryByManager.action?currpage="+currentPage+"&fileId="+fileId+"&sectionId="+sectionId+"&searchTime="+searchTime;
				}
				</SCRIPT>
	</head>
	<body>
		<div class="PageChild_Title">
			<img src=" themes/images/default/icons/archives.png"
				class="PageChild_Tbtnpic" />
			<span class="PageChild_separate"></span>
			<span class="PageChild_TbtnText"><h2>
					查询文件归档信息
				</h2>
			</span>
			<span class="PageChild_separate"></span>
			<div id="marker" class="red-tips">
			</div>
			<div class="clear">
			</div>
		</div>
		<div class="PageChild_Where">
			<table style="height: 60px;" border="0" cellpadding="0"
				cellspacing="0">
				<tr>
					<td class="mtd">
							&nbsp;文件归档信息:
							<s:select list="fileList" listKey="fileId"
								listValue="title" id="search_drl_fileInfo" headerKey="" headerValue="-请选择-" theme="simple" name="fileId"></s:select>
							&nbsp;创建日期:
							<input name="submitTime" id="search_txt_submitTime" class="input-control NeedDate" value="${searchTime }"/>
							&nbsp;部门:
							<s:select list="sectionList" listKey="sectionId" 
								listValue="sectionName" headerKey="" headerValue="-请选择-" id="search_drl_sectionInfo" name="sectionId" theme="simple"></s:select>
					</td>
					<td class="mtd">
							&nbsp;
							<input type="button" id="searchButton"
							class="o-btn SubmitButton" value="搜 索" onclick='goToPage(1)'/>
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<span id="lbl_list_count">共搜索到 <b>${count}</b> 条符合条件的记录。</span>
					</td>
				</tr>
			</table>
		</div>
		<div class="PageChild_List">
			<table width="100%" border="0" cellspacing="0"
				style="text-align: left">
				<tbody class="PageChild_List_head">
					<tr>
						<td width="16">
							<input id="Chk_All" type="checkbox" name="Chk_All"
								onclick="checkAll('Chk_Num')" />
						</td>
						<td width="16">
							<img src="themes/images/default/icons/pcde_314.png" width="16"
								height="16" />
						</td>
						<td>
							文件归档名称
						</td>
						<td>
							文件名
						</td>
						<td>
							文件摘要
						</td>
						<td>
							提交人
						</td>
						<td>
							所属部门
						</td>
						<td>
							创建时间
						</td>
						<td class="td_width40">
							下载
						</td>
						<td class="td_width40">
							删除
						</td>
					</tr>
				</tbody>
				<tbody class="PageChild_List_main" style="text-align: left">
					<s:if test="submitList != null && submitList.size != 0">
					<s:iterator value="submitList" var="item" status="no">
						<tr class='td_no_bord'>
							<td class="td_width25">
								<span title="24"><input id="Chk_Num" type="checkbox"
										 value="${item.id}" /> </span>
							<br></td>
							<td class="td_width25">
								<s:property value="#no.count" />
							</td>
							<td>
								<span>${item.fileInfo.title} </span>&nbsp;
							</td>
							<td>
								<span>${item.uploadName}</span>&nbsp;
							</td>
							<td>
								<span>${item.abstracts}</span>&nbsp;
							</td>
							<td>
								<span>${item.staffInfo.archiveInfo.staffName}</span>&nbsp;
							</td>
							<td>
								<span>${item.staffInfo.archiveInfo.postInfo.sectionInfo.sectionName}</span>&nbsp;
							</td>
							<td>
								<span>${item.strSubmitTime}</span>&nbsp;
							</td>
							<td>
								<a href="${item.fileInfo.fileUrl}/${item.uploadName}" target="_blank">下载</a>
							</td>
							<td>
								<a href="javascript:void(0);" class="ui-link-delete-button"
									entityId="${item.id}" onclick=''><img
										src="themes/icons/delete.png" /> </a>
							</td>
						</tr>
					</s:iterator>
					</s:if><s:else>
						<tr><td colspan="10">无记录</td></tr>
					</s:else>
				</tbody>
			</table>
		</div>
		<div>
			<input type="button" name="btn_Delete" class="o-btn SubmitButton"
				value="删 除" id="btn_Delete"
				onclick="deleteAll('Chk_Num')">
		</div>
		<!--分页导航开始-->
		<div id="divTopPageNavi" class="list_r_title_text3">
		<input class="hiddenObject" value="${currpage }" id="currentPage">
			<s:if test="currpage<=1">
				<span class='list_r_title_text3a'> <img
						src=" themes/images/default/page_up_gray.gif"></img> </span>

			</s:if>
			<s:else>
				<span class='list_r_title_text3a'> <a name="link_page_prev"
					id="link_page_prev" href="javascript:void(0);"
					currentPage="${currpage-1}"> <img
							src=" themes/images/default/page_up.gif"></img> </a> </span>
			</s:else>
			<span class='list_r_title_text3b'> 第${currpage }页/共${totalpage
				}页 </span>
			<s:if test="currpage>=totalpage">
				<span class='list_r_title_text3a'> <img
						src=" themes/images/default/page_down_gray.gif"></img> </span>
			</s:if>
			<s:else>
				<span class='list_r_title_text3a'> <a name="link_page_next"
					id="link_page_next" href="javascript:void(0);"
					currentPage="${currpage+1 }"> <img
							src=" themes/images/default/page_down.gif"></img> </a> </span>
			</s:else>
			<span id="goToPageTextArea"><input type="text"
					class="easyui-numberbox" id="goPageNum" max="${totalpage}" min="1" />
				<input type="button" id="turnToPageButton" value="GO" />
			</span>
		</div>
		<!--分页导航结束-->
	</body>
</html>